package org.lc.cmd.plugin.scan;

import org.lc.cmd.ResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ResultManager {
    @Autowired
    private List<ResultHandler> resultHandlers;


    public void handleResult(Object result, String line) {
        for (ResultHandler handler : resultHandlers) {
            if (result == null) {
                break;
            }
            result = handler.handle(result, line);
        }
    }
}
